module.exports = {
  transpileDependencies: ['common'],
  chainWebpack: config => {
    config.plugin('html')
      .tap((args) => {
        args[0].title = 'qiankun-example'
        return args
      })
  },
  devServer: {
    headers: {
      'Access-Control-Allow-Origin': '*'
    },
    proxy: {
      '/api_basedata/': {
        target: 'http://localhost:8888',
        changeOrigin: true
        // bypass: function (req, res, proxyOptions) {
        //   console.log("----api_basedata res----");
        // },
      },
      '/api_wzh': {
        target: 'http://localhost:8888', // 无纸化病案
        ws: true,
        changeOrigin: true,
        pathRewrite: {
          '^/api_wzh': ''
        }
        // bypass: function (req, res, proxyOptions) {
        //   console.log("----api_wzh res----");
        // },
      },
      '/api': {
        target: 'http://localhost:8888', // 无纸化病案-api
        ws: true,
        changeOrigin: true
        // bypass: function (req, res, proxyOptions) {
        //   console.log("----api res----");
        // },
      }
    },
    open: process.env.NODE_ENV === 'development',
    port: '8000'
  }
}
